﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using LeadTeam.Exam.Entities;
using LeadTeam.Exam.Utility;
using LeadTeam.Exam.AdminTool.Forms;

namespace LeadTeam.Exam.AdminTool
{
   public  class AddOrganizationsController:BaseController
    {
        public AddOrganizations view;
        public Organizations model;

        public AddOrganizationsController(AddOrganizations view,IMainFormView iMainFormView):base(iMainFormView)
        {
            this.view = view;
            this.view.Controllor = this;
        }

        public IMainFormView MainFormHandle
        {
            get { return base.iMainFormView; }
        }

        public void AddOrganizationsEntityChild()
        {
            if (model == null)
                return;

            RequestHelper.RequestInvoke<Organizations>((ConfigHelper.GetRootServiceUrl() + "Organization/AddChild"), RequestMethod.POST, model);
        }

        public void AddOrganizationsEntityParent(string id)
        {
            if (model == null)
                return;

            RequestHelper.RequestInvoke<Organizations>((ConfigHelper.GetRootServiceUrl() + "Organization/AddParent/"+id), RequestMethod.POST, model);
        }
    }
}
